#include <head.h>

int main(int argc, char const *argv[])
{
    int val = 1234;
    pid_t pid  = 0;

    if (-1 == (pid = fork()))
    {
        ERRLOG("子进程创建失败");
        return 0;
    }

    else if (0 == pid) // 子进程
    {
        printf("我是子进程pid == %d\n" , getpid());
        printf("我是子进程ppid == %d\n" , getppid());
    }


    else if (0 < pid) // 父进程
    {
        printf("我是父进程pid == %d\n" , getpid());
        printf("我是父进程ppid == %d\n" , getppid());
        sleep(1);
    }    
    
}